[Instances] Reinstall operating system on a compute instance
curl --request POST \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_key_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enable_password_auth": false,
"install_management_key": true,
"software_packages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {}
}
]
}
'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall"
payload = {
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_key_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"enable_password_auth": False,
"install_management_key": True,
"software_packages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
volume_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_key_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
enable_password_auth: false,
install_management_key: true,
software_packages: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', parameters: {}}]
})
};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'volume_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_key_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'enable_password_auth' => false,
'install_management_key' => true,
'software_packages' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parameters' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall"
payload := strings.NewReader("{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyCompute
[Instances] Reinstall operating system on a compute instance
Reinstall the operating system on a compute instance. This operation will erase all data on the primary disk and install a fresh OS from the specified image. The instance must be stopped before reinstallation. This action is irreversible.
POST
/
v1
/
organizations
/
{organization_id}
/
projects
/
{project_id}
/
compute
/
instances
/
{id}
/
reinstall
[Instances] Reinstall operating system on a compute instance
curl --request POST \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_key_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"enable_password_auth": false,
"install_management_key": true,
"software_packages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {}
}
]
}
'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall"
payload = {
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_key_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"enable_password_auth": False,
"install_management_key": True,
"software_packages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
volume_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_key_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
enable_password_auth: false,
install_management_key: true,
software_packages: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', parameters: {}}]
})
};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'volume_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_key_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'enable_password_auth' => false,
'install_management_key' => true,
'software_packages' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parameters' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall"
payload := strings.NewReader("{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/reinstall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"enable_password_auth\": false,\n \"install_management_key\": true,\n \"software_packages\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parameters\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Use Authorization: Bearer <token> header. Token can be a JWT token or an API key (format: sk-onetsolutions-...).
Path Parameters
A UUID string identifying this Instance.
Unique identifier of the organization that owns the resource.
Unique identifier of the project containing the resource.
Body
application/json
Response
Instance reinstallation initiated successfully
⌘I

